<template>
	<view>
		<view class="goods-item" @click="handClick(goods.id)">
			<u-image class="u-skeleton-fillet" width="100%" height="300rpx" :src="goods.cover_url"></u-image>
			<view class="title u-line-1 u-skeleton-rect">{{goods.title ? goods.title : '商品名称'}}</view>
			<view class="u-flex u-row-between">
				<view class="price u-skeleton-rect">￥ {{goods.price}}</view>
				<view class="sales u-skeleton-rect">销量：{{goods.sales}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"goods-card",
		props:{
			goods:{
				type:Object,
				default(){
					return{}
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			handClick(id){
				this.$emit('myClick',id)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.goods-item {
		margin-bottom: 30rpx;
		margin-left: 20rpx;
		margin-right: 20rpx;
		.title {
			text-align: center;
			margin: 10rpx 0;
			font-weight: 700;
			font-size: 30rpx;
			width: 100%;
		}
		.price {
			color:red;
		}
		.sales {
			color:#888;
		}
	}
</style>
